#include <cstdio>

double f[ 1502 ];

void init( )
{
    int i;
    double t = 0.5;
    f[ 0 ] = 0;
    f[ 1 ] = 1;
    for ( i = 2; i <= 1500; i += 2 )
    {
        f[ i ] = f[ i - 1 ] + t;
        f[ i + 1 ] = f[ i ] + t;
        t = t * i * ( i + 1 ) / ( i / 2 ) / ( i - i / 2 + 1 ) / 4;
    }
}

int main( )
{
    int n, cas = 1, t;
    init( );
    scanf("%d", &t);
    while ( t-- )
    {
        scanf("%d", &n);
        printf("Case %d: %.6lf\n", cas++, f[ n ]);
    }
    return 0;
}
